{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}">
    <script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap.min.js' %}"></script>
    <!--[if lt IE 9]>
        <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#navbar-collapse-basepage">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="{% url 'homepage' %}" class="navbar-brand">Library</a>
        </div>

        <div class="collapse navbar-collapse" id="navbar-collapse-basepage">
            <ul class="nav navbar-nav">
                <li id="homepage"><a href="{% url 'homepage' %}">主页</a></li>
               {% if user %}
                    {% if user.is_staff %}
                        <li id="add_book"><a href="{% url 'add_book' %}">添加图书</a></li>
                        <li id="add_img"><a href="{% url 'add_img' %}">添加图片</a></li>
                   {% endif %}
                    <li id="view_book"><a href="{% url 'book_list' 'all' %}">查看图书</a></li>
                {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if user %}
                    <li><p class="navbar-text">欢迎你&nbsp;&nbsp;<span id="base_name">{{ user.username }}</span></p>
                    </li>
                    <li><a href="{% url 'logout' %}">注销</a></li>
                    <li><a href="{% url 'change_password' %}">修改密码</a></li>
                {% else %}
                    <li><a href="{% url 'sign_up' %}">注册</a></li>
                    <li><a href="{% url 'login' %}">登录</a></li>
                {% endif %}
            </ul>
        </div>

    </div>
</nav>

<header class="jumbotron subhead" id="header-base">
    <div class="container">
        <h1>图书管理系统</h1>
        <h3>&emsp;&emsp;书籍是横渡时间大海的航船----培根</h3>
    </div>
</header>

{% block content %}

{% endblock %}

<footer class="footer" role="contentinfo">
    <hr>
    <div class="container">
        <p class="text-center">©All rights reserved</p>
        <h5 class="text-center"> Powered by&nbsp;<a href="http://www.0922.com/">SunXinJi</a></h5>
    </div>
</footer>
</body>
</html>